<?php
/** @var ContactoController $this */
/** @var Contacto $model */
Util::tsRegisterAssetJs('contactos.js');
Util::tsRegisterAssetJs('view.js');
Yii::app()->clientScript->registerScriptFile('https://maps.googleapis.com/maps/api/js?sensor=true&language=es');
$this->pageTitle = $model->nombre_completo_titulo;
?>
<script>
    var entidad_id = "<?php print $model->id; ?>";
</script>
<div class="row-fluid">
    <div class="span12">
        <h1 class="name-title"><i class="icon-user"></i> <?php echo $model->nombre_completo_titulo ?></h1>
        <div class="star-title">
            <?php
            Util::checkAccess(array("action_cuenta_rating")) ?
                            $this->widget('CStarRating', array(
                                'name' => 'rating',
                                'id' => "rating_" . $model->id,
                                'value' => $model->rating,
                                'allowEmpty' => false,
                                'maxRating' => 5,
                                'htmlOptions' => array("class" => "star-rating"),
                                'callback' => "function(){
                            rating($model->id);
                        }"
                                    )
                            ) : ''
            ?>
        </div>
    </div>
</div>

<div class="row-fluid">
    <div class="span7">
        <?php $this->renderPartial('portlets/_info', array('model' => $model)); ?>
        <?php Util::checkAccess(array("action_nota_admin")) ? $this->renderPartial('portlets/_notas', array('model' => $model, 'archivos' => $archivos)) : ''; ?>
        <div class="widget">
            <div class="widget-title">
                <h4><i class="icon-tasks"></i> Actividades</h4>
                <span class="tools">
                    <a href="javascript:;" class="icon-chevron-down"></a>
                    <a href="javascript:;" class="icon-remove"></a>
                </span>
            </div>
            <div class="widget-body">
                <div id="portlet_actividades" class="widget-tareas">
                    <?php $this->renderPartial('portlets/_actividades', array('model' => $model, 'modal' => false)); ?>
                </div>
            </div>
        </div>
        <?php Util::checkAccess(array("action_default_index")) ? $this->renderPartial('portlets/_encuestas', array('model' => $model)) : NULL; ?>
        <?php // $this->renderPartial('portlets/_email', array('model' => $model)) ?>
    </div>

    <div class="span5">
        <?php $this->renderPartial('portlets/_calendario', array('model' => $model)); ?>
        <?php Util::checkAccess(array("action_tarea_admin")) ? $this->renderPartial('portlets/_tareas', array('model' => $model)) : ''; ?>
        <?php ($model->cuenta_id != NULL && Util::checkAccess(array("action_oportunidad_admin"))) ? $this->renderPartial('portlets/_oportunidades', array('model' => $model)) : NULL; ?>
        <?php // ($model->cuenta_id != NULL && Util::checkAccess(array("action_cobranza_admin"))) ? $this->renderPartial('portlets/_cobranzas', array('model' => $model)) : NULL; ?>
        <?php ($model->cuenta_id != NULL && Util::checkAccess(array("action_incidencia_ajaxCreate"))) ? $this->renderPartial('portlets/_incidencias', array('model' => $model)) : NULL; ?>

    </div>
</div>
